package com.example.testrest;

import java.io.IOException;
import java.util.Vector;

import org.restlet.resource.ClientResource;
import org.restlet.resource.ResourceException;

import restlet.interfaces.TripLineResourceI;
import beans.TripLine;

public class TestTripLine {
	public static void main(String[] args) throws ResourceException,
			IOException {

		String mestoOd = "SUBOTICA";
		String mestoDo = "ZRENJANIN";
		String povlasticaID = "5";

		ClientResource cr = new ClientResource(
				"http://localhost:8080/rest/tripLines/" + mestoOd + "/"
						+ mestoDo + "/" + povlasticaID);

		TripLineResourceI tripLinesResourceI = cr.wrap(TripLineResourceI.class);
		Vector<TripLine> tripLines = tripLinesResourceI.allTripLines();

		for (TripLine tl : tripLines) {
			System.out.println(tl);
		}

		System.out.println(tripLines.size());
	}
}
